﻿package com.ease.platform.model.type
{
	import com.ease.common.enums.OptionalEnum;
	import com.ease.lang.Enum;
	import com.ease.lang.EnumConstants;
	import com.ease.platform.model.type.PermissionType;

	[Bindable]
	[RemoteClass(alias="com.ease.platform.model.type.PermissionType")]

	public class PermissionType extends Enum
	{
		/* static init */
		{ initEnum(PermissionType); }

		/* Constants */
		public static const Other:PermissionType = new PermissionType("Other", 0, "Other");
		public static const ViewLocation:PermissionType = new PermissionType("ViewLocation", 1, "ViewLocation");
		public static const OperateLocation:PermissionType = new PermissionType("OperateLocation", 2, "OperateLocation");
		public static const MainMenu:PermissionType = new PermissionType("MainMenu", 3, "MainMenu");
		public static const Action:PermissionType = new PermissionType("Action", 4, "Action");
		public static const Explorer:PermissionType = new PermissionType("Explorer", 5, "Explorer");
		public static const PerspectiveView:PermissionType = new PermissionType("PerspectiveView", 6, "PerspectiveView");

		private var _value:int;
		private var _text:String;

		/*public*/ function PermissionType(name:String=null ,value:int=0 ,text:String=null) {
			super.name = name;
			this._value = value;
			this._text = text;
		}

		public function get value():int  { return this._value; }
		public function get text():String  { return this._text; }

		/* constant query */
		public static function getEnumConstants():Array {
			return Enum.getEnumConstants(PermissionType);
		}

		public static function get(constantName:String, caseSensitive:Boolean = false):PermissionType {
			return PermissionType(Enum.get(PermissionType, constantName, caseSensitive));
		}
	}
}